package com.gmd.model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the recetamedica_medicamento database table.
 * 
 */
@Embeddable
public class RecetamedicaMedicamentoPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private int idrecetamedica;
	private int idmedicamento;

	public RecetamedicaMedicamentoPK() {
	}

	@Column(unique=true, nullable=false)
	public int getIdrecetamedica() {
		return this.idrecetamedica;
	}
	public void setIdrecetamedica(int idrecetamedica) {
		this.idrecetamedica = idrecetamedica;
	}

	@Column(unique=true, nullable=false)
	public int getIdmedicamento() {
		return this.idmedicamento;
	}
	public void setIdmedicamento(int idmedicamento) {
		this.idmedicamento = idmedicamento;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof RecetamedicaMedicamentoPK)) {
			return false;
		}
		RecetamedicaMedicamentoPK castOther = (RecetamedicaMedicamentoPK)other;
		return 
			(this.idrecetamedica == castOther.idrecetamedica)
			&& (this.idmedicamento == castOther.idmedicamento);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.idrecetamedica;
		hash = hash * prime + this.idmedicamento;
		
		return hash;
	}
}